﻿using System;
using System.Linq;
using WikeSoft.Enterprise.Entities;

namespace WikeSoft.Enterprise.CodeFirst
{

    class Program
    {
        static void Main(string[] args)
        {  
            string fileDir = Environment.CurrentDirectory;
             
            //string newConfigFilePath = fileDir+ "\\App_Mysql.config";
            ////string newConfigFilePath = fileDir + "\\App_Oracle.config";
            ////string newConfigFilePath = fileDir + "\\App_SQLServer.config";
            //if (System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile != newConfigFilePath)
            //    AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", newConfigFilePath);

            using (var ctx = new WikeDbContext())
            {

                var query = ctx.SysUsers.Where(x => true);

                var list = query.ToList();

                //var users = ctx.Users.Where(x => true);
                var data = ctx.SysUsers.FirstOrDefault(x => x.Id == "D34BE365-8F07-4FEE-9713-B079EC4AF9A3");
                var deparmt =data.SysDepartment.DepartmentName;

                //int a = 0;
            }

            Console.WriteLine("\n\n按[回车]键退出...");
            Console.ReadLine();
        }
    }
}
